home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 2.iso / bin / stopServer < prev    next >
Text File  |  1996-11-11  |  825b  |  44 lines

  1. #!/bin/csh -f
  2.  
  3. #
  4. # update path to also look in the same directory from where this script
  5. # was executed from
  6. #
  7.  
  8. set path = (/usr/bsd /bin /usr/bin /usr/sbin /usr/bin/X11)
  9. set DT_xconfirm = "$DT_utilities/DT_xconfirm"
  10.  
  11. set path = (${DT_util_path} $path)
  12.  
  13. #
  14. # make sure our server is running, and there is something to kill :-)
  15. #
  16.  
  17. isServerRunning
  18.  
  19. if ($status == 0) then
  20.     $DT_xconfirm error "Server is not running."
  21.     exit 2
  22. endif
  23. #
  24. # find out and remember the user name
  25. #
  26.  
  27. if ($?HOME) then
  28.     set userName = ~$USER
  29. else
  30.     $DT_xconfirm nohome
  31.     exit 0
  32. endif
  33.  
  34. echo "http server:                     stopped (pid `cat $userName/$DT_WWW_ROOT/logs/httpd.pid`)"
  35.  
  36. kill -9 `cat $userName/$DT_WWW_ROOT/logs/httpd.pid`
  37.  
  38. #
  39. # an indication that server has been killed
  40. #
  41. /usr/bin/rm $userName/$DT_WWW_ROOT/logs/httpd.pid
  42.  
  43. exit 1
  44.